package proxy.example.staticproxy;

import proxy.example.GiveGift;
import proxy.example.Pursuit;
import proxy.example.SchoolGirl;

/**
 * 静态代理例子
 * 代理人
 * @author Chen Guang
 * @date 2019/3/29 0029 下午 16:32
 */
public class Proxy implements GiveGift {

    private Pursuit pursuit;

    public Proxy(SchoolGirl mm) {
        this.pursuit = new Pursuit(mm);
    }

    @Override
    public void giveDolls() {
        System.out.println("我代替XXX送你：");
        pursuit.giveDolls();
        System.out.println("希望你答应");
    }

    @Override
    public void giveFlowers() {
        System.out.println("我代替XXX送你：");
        pursuit.giveFlowers();
        System.out.println("希望你答应");
    }

    @Override
    public void giveChocolate() {
        System.out.println("我代替XXX送你：");
        pursuit.giveChocolate();
        System.out.println("希望你答应");
    }
}
